﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace SageKing.Database.Contracts;


/// <summary>
/// 分页接口
/// </summary>
/// <typeparam name="T">条件参数</typeparam>
/// <typeparam name="R">返参数</typeparam>
public interface IEntityPage<T, R> : IPageBase<R>
{
    /// <summary>
    /// 分页获取集合 🔖
    /// </summary>
    /// <returns></returns>
    /// <param name="input"></param>
    /// <param name="orderby"></param>
    /// <param name="orderByAsc">true:asc,false:desc</param>
    [DisplayName("获取获取集合")]
    /// <returns></returns>
    public Task<PageBase<R>> GetPage(PageBaseInput page, Expression<Func<T, object>> orderby, bool orderByAsc = true);

    /// <summary>
    /// 分页获取集合 🔖
    /// </summary>
    /// <returns></returns>
    [DisplayName("获取获取集合")]
    /// <param name="orderByAsc">true:asc,false:desc</param>
    public Task<PageBase<R>> GetPage(PageBaseInput page, List<(bool, Expression<Func<T, bool>>)> whereIf, Expression<Func<T, object>> orderby, bool orderByAsc = true);

}
